#include "com.hpp"
#define NAMED_PIPE "/tmp/mypipe.110"
int main()
{
    int wfd = open(NAMED_PIPE,O_WRONLY);
    if(wfd < 0) exit(1);
    char buffer[1024];
    //write
    while(1)
    {
        cout<<"Please Say# ";
        fgets(buffer ,sizeof(buffer),stdin);
        buffer[strlen(buffer)-1] = 0;
        ssize_t n = write(wfd , buffer ,strlen(buffer));
        assert(n == strlen(buffer));
        (void)n;
    }
    close(wfd);
    return 0;
}